package cn.zptc.springbootdemo.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author ：zhaoweiwei
 * @date ：创建于 2025/3/13 14:13
 * @description：
 * @modified By：
 * @version: 1.0.0
 */

@Controller
public class LoginController {

    @GetMapping("/toLoginPage")
    public String toLoginPage(Model model){
        model.addAttribute("currentYear", Calendar.getInstance().get(Calendar.YEAR));
        Date time = Calendar.getInstance().getTime();
        String format = SimpleDateFormat.getDateInstance().format(time);
        model.addAttribute("currentDate", format);
        return "login";
    }
}
